package com.bwie.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * 商品表
 * @TableName goods
 */
@TableName(value ="goods")
public class Goods {
    /**
     * 商品id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 商品编号
     */
    private String gnum;

    /**
     * 商品名称
     */
    private String gname;

    /**
     * 商品价格
     */
    private Double price;

    /**
     * 团购价格
     */
    private Double groupbuyingprice;

    /**
     * 团购数量
     */
    private Integer groupbuyingcount;

    /**
     * 剩余库存
     */
    private Integer residuecount;

    /**
     * 库存
     */
    private Integer count;

    /**
     * 成团人数
     */
    private Integer groupsize;

    /**
     * 预警值
     */
    private Integer prewarningvalue;

    /**
     * 限制数量
     */
    private Integer restrictcount;

    @TableField(exist = false)
    private Integer groupId;

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Goods(Integer groupId, String title) {
        this.groupId = groupId;
        this.title = title;
    }

    @TableField(exist = false)
    private String title;

    /**
     * 商品id
     */
    public Integer getId() {
        return id;
    }

    /**
     * 商品id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 商品编号
     */
    public String getGnum() {
        return gnum;
    }

    /**
     * 商品编号
     */
    public void setGnum(String gnum) {
        this.gnum = gnum;
    }

    /**
     * 商品名称
     */
    public String getGname() {
        return gname;
    }

    /**
     * 商品名称
     */
    public void setGname(String gname) {
        this.gname = gname;
    }

    /**
     * 商品价格
     */
    public Double getPrice() {
        return price;
    }

    /**
     * 商品价格
     */
    public void setPrice(Double price) {
        this.price = price;
    }

    /**
     * 团购价格
     */
    public Double getGroupbuyingprice() {
        return groupbuyingprice;
    }

    /**
     * 团购价格
     */
    public void setGroupbuyingprice(Double groupbuyingprice) {
        this.groupbuyingprice = groupbuyingprice;
    }

    /**
     * 团购数量
     */
    public Integer getGroupbuyingcount() {
        return groupbuyingcount;
    }

    /**
     * 团购数量
     */
    public void setGroupbuyingcount(Integer groupbuyingcount) {
        this.groupbuyingcount = groupbuyingcount;
    }

    /**
     * 剩余库存
     */
    public Integer getResiduecount() {
        return residuecount;
    }

    /**
     * 剩余库存
     */
    public void setResiduecount(Integer residuecount) {
        this.residuecount = residuecount;
    }

    /**
     * 库存
     */
    public Integer getCount() {
        return count;
    }

    /**
     * 库存
     */
    public void setCount(Integer count) {
        this.count = count;
    }

    /**
     * 成团人数
     */
    public Integer getGroupsize() {
        return groupsize;
    }

    /**
     * 成团人数
     */
    public void setGroupsize(Integer groupsize) {
        this.groupsize = groupsize;
    }

    /**
     * 预警值
     */
    public Integer getPrewarningvalue() {
        return prewarningvalue;
    }

    /**
     * 预警值
     */
    public void setPrewarningvalue(Integer prewarningvalue) {
        this.prewarningvalue = prewarningvalue;
    }

    /**
     * 限制数量
     */
    public Integer getRestrictcount() {
        return restrictcount;
    }

    /**
     * 限制数量
     */
    public void setRestrictcount(Integer restrictcount) {
        this.restrictcount = restrictcount;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Goods other = (Goods) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGnum() == null ? other.getGnum() == null : this.getGnum().equals(other.getGnum()))
            && (this.getGname() == null ? other.getGname() == null : this.getGname().equals(other.getGname()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getGroupbuyingprice() == null ? other.getGroupbuyingprice() == null : this.getGroupbuyingprice().equals(other.getGroupbuyingprice()))
            && (this.getGroupbuyingcount() == null ? other.getGroupbuyingcount() == null : this.getGroupbuyingcount().equals(other.getGroupbuyingcount()))
            && (this.getResiduecount() == null ? other.getResiduecount() == null : this.getResiduecount().equals(other.getResiduecount()))
            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
            && (this.getGroupsize() == null ? other.getGroupsize() == null : this.getGroupsize().equals(other.getGroupsize()))
            && (this.getPrewarningvalue() == null ? other.getPrewarningvalue() == null : this.getPrewarningvalue().equals(other.getPrewarningvalue()))
            && (this.getRestrictcount() == null ? other.getRestrictcount() == null : this.getRestrictcount().equals(other.getRestrictcount()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGnum() == null) ? 0 : getGnum().hashCode());
        result = prime * result + ((getGname() == null) ? 0 : getGname().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getGroupbuyingprice() == null) ? 0 : getGroupbuyingprice().hashCode());
        result = prime * result + ((getGroupbuyingcount() == null) ? 0 : getGroupbuyingcount().hashCode());
        result = prime * result + ((getResiduecount() == null) ? 0 : getResiduecount().hashCode());
        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
        result = prime * result + ((getGroupsize() == null) ? 0 : getGroupsize().hashCode());
        result = prime * result + ((getPrewarningvalue() == null) ? 0 : getPrewarningvalue().hashCode());
        result = prime * result + ((getRestrictcount() == null) ? 0 : getRestrictcount().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", gnum=").append(gnum);
        sb.append(", gname=").append(gname);
        sb.append(", price=").append(price);
        sb.append(", groupbuyingprice=").append(groupbuyingprice);
        sb.append(", groupbuyingcount=").append(groupbuyingcount);
        sb.append(", residuecount=").append(residuecount);
        sb.append(", count=").append(count);
        sb.append(", groupsize=").append(groupsize);
        sb.append(", prewarningvalue=").append(prewarningvalue);
        sb.append(", restrictcount=").append(restrictcount);
        sb.append("]");
        return sb.toString();
    }
}